package com.excetop.xservlet.req.param;

/**
 * int 参数
 * @author xuZW
 *
 */
public class IntParam extends TextParam {

	/**
	 * int 参数值
	 */
	private int intValue;
	
	/**
	 * int 参数值数组
	 */
	private int[] intValueArray;

	public IntParam() {
	}
	
	public IntParam(String name, String[] textValueArray) {
		this(name, textValueArray, null);
	}
	
	public IntParam(String name, String[] textValueArray, String[] patternArray) {
		super(name, textValueArray, patternArray);
		setType(TYPE_INT);
		String[] values = getTextValueArrayWithoutSpaceCharacter();
		if(null != values && values.length > 0){
			intValueArray = new int[values.length];
			for (int i = 0; i < intValueArray.length; i++) {
				try { intValueArray[i] = Integer.valueOf(values[i]); }
				catch (Exception e) {}
			}
		}
		String value = getTextValueWithoutSpaceCharacter();
		if(null != value){
			try { intValue = Integer.valueOf(value); }
			catch (Exception e) {}
		}
	}
	
	public int getIntValue() {
		return intValue;
	}

	public void setIntValue(int intValue) {
		this.intValue = intValue;
	}

	public int[] getIntValueArray() {
		return intValueArray;
	}

	public void setIntValueArray(int[] intValueArray) {
		this.intValueArray = intValueArray;
	}

	@Override
	public boolean verifying() {
		boolean result = true;
		// TODO Auto-generated method stub
		return result;
	}
}
